package org.jash.mvp2206.net;

import org.jash.mvp2206.entity.AllCategory;
import org.jash.mvp2206.entity.AllVideo;
import org.jash.mvp2206.entity.CheckCode;
import org.jash.mvp2206.entity.CommentEntity;
import org.jash.mvp2206.entity.DetailEntity;
import org.jash.mvp2206.entity.LoginEntity;
import org.jash.mvp2206.entity.NewsPage;
import org.jash.mvp2206.entity.RegisterEntity;
import org.jash.mvp2206.entity.SendEntity;
import org.jash.mvp2206.entity.TopHot;
import org.jash.mvp2206.entity.VerifyCode;

import java.util.Map;

import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface ApiServer {
    @POST("/api/user/loginname")
    Observable<LoginEntity> login(@Body Map<String, String> map);
    @GET("/api/sms/sendrcode")
    Observable<VerifyCode> getVerifyCode(@Query("phone") String phone);
    @POST("/api/sms/checkrcode")
    Observable<CheckCode> checkCode(@Body Map<String, String> map);
    @POST("/api/user/register")
    Observable<RegisterEntity> register(@Body Map<String, String> map);
    @GET("/api/nt/all")
    Observable<AllCategory> getCategories();
    @GET("/api/news/tophot")
    Observable<TopHot> getTopHot();
    @GET("/api/news/page")
    Observable<NewsPage> getNewsPage(@Query("type") int type,@Query("page") int page,@Query("size") int size);
    @GET("/api/news/detail")
    Observable<DetailEntity> getNewsDetail(@Query("id") int id);
    @GET("/api/video/all")
    Observable<AllVideo> getAllVideo();
    @GET("/api/newsComment/comments")
    Observable<CommentEntity> getCommentByNewsId(@Query("nid") int nid);
    @POST("/api/newsComment/save")
    Observable<SendEntity> sendComment(@Body Map<String, Object> map);
}
